/*AyflEomXWyqCHfdTxzWda3ExHehXzPX6thlzEnTk9yg=*/
/*
 * @Author: llixxm
 * @Date: 2021-08-09 17:14:33
 * @Description: 收/付代办事项
 */
import React, { Component } from 'react';
import getWidgetIcon from '../pubUtils/getWidgetIcon.js';
import './index.less'

export default class WidgetItem extends Component {
    constructor(props) {
        super(props);
        this.state = {

        }
    }
    static defaultProps = {
        title: '', //标题
        searchContent: '', //查询区过滤组件
        extendContent: '', //扩展区域--标题区域最右侧
        bodyContent: '', //内容
        widgetId: '', //小部件样式id
    };
    // 渲染数数据
	renderCount = (item) => {
        let { onSkip } = this.props
		return(
			<p className='numinfo'
				onClick={()=>{onSkip && onSkip(item.id)}}
			>
				<span className="numinfo-status nc-theme-title-font-c">{item.countStatus}</span>
				<span className="numinfo-num nc-theme-title-font-c">{item.count}</span>
			</p>
		)
	}
    render(){
        let { data, className } = this.props;
        let { type, title, countInfo } = data;
        let imgName = getWidgetIcon(type);
        let srcUrl = require('../../assets/svg/' + imgName);
        return(
            <div className={`def-item-container nc-theme-zrow-bgc ${className}`}>
				<div className="data-img-container">
                    <div className='data-img'>
						<img src={srcUrl} />
					</div>
					<div className="data-img-title">{title}</div>
				</div>
                <div className='data-num-container'>
                    <div className="data-num">
                        {countInfo.map(item => { return this.renderCount(item)})}
                    </div>
                </div>
			</div>
        )
    }
}

/*AyflEomXWyqCHfdTxzWda3ExHehXzPX6thlzEnTk9yg=*/